﻿using System.Windows;
namespace WPFExcelReport
{
    public partial class ViewBase
    {
        #region ==IsSJH===========
        public static readonly DependencyProperty IsSJHProperty = DependencyProperty.Register("IsSJH",
        typeof(bool), typeof(ViewBase),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsSJHChanged));
        public bool IsSJH
        {
            get
            {
                return (bool)GetValue(IsSJHProperty);
            }
            set
            {
                SetValue(IsSJHProperty, value);
            }
        }
        private static void OnIsSJHChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.IsSJH = (bool)e.NewValue;
            }
        }
        #endregion
        #region ==IsSYH===========
        public static readonly DependencyProperty IsSYHProperty = DependencyProperty.Register("IsSYH",
        typeof(bool), typeof(ViewBase),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsSYHChanged));
        public bool IsSYH
        {
            get
            {
                return (bool)GetValue(IsSYHProperty);
            }
            set
            {
                SetValue(IsSYHProperty, value);
            }
        }
        private static void OnIsSYHChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.IsSYH = (bool)e.NewValue;
            }
        }
        #endregion
        #region ==IsFHT===========
        public static readonly DependencyProperty IsFHTProperty = DependencyProperty.Register("IsFHT",
        typeof(bool), typeof(ViewBase),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsFHTChanged));
        public bool IsFHT
        {
            get
            {
                return (bool)GetValue(IsFHTProperty);
            }
            set
            {
                SetValue(IsFHTProperty, value);
            }
        }
        private static void OnIsFHTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.IsFHT = (bool)e.NewValue;
            }
        }
        #endregion
        #region ==IsUBT===========
        public static readonly DependencyProperty IsUBTProperty = DependencyProperty.Register("IsUBT",
        typeof(bool), typeof(ViewBase),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsUBTChanged));
        public bool IsUBT
        {
            get
            {
                return (bool)GetValue(IsUBTProperty);
            }
            set
            {
                SetValue(IsUBTProperty, value);
            }
        }
        private static void OnIsUBTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.IsUBT = (bool)e.NewValue;
            }
        }
        #endregion
        #region ==IsJLT===========
        public static readonly DependencyProperty IsJLTProperty = DependencyProperty.Register("IsJLT",
        typeof(bool), typeof(ViewBase),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsJLTChanged));
        public bool IsJLT
        {
            get
            {
                return (bool)GetValue(IsJLTProperty);
            }
            set
            {
                SetValue(IsJLTProperty, value);
            }
        }
        private static void OnIsJLTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.IsJLT = (bool)e.NewValue;
            }
        }
        #endregion
        #region ==IsYCA===========
        public static readonly DependencyProperty IsYCAProperty = DependencyProperty.Register("IsYCA",
        typeof(bool), typeof(ViewBase),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsYCAChanged));
        public bool IsYCA
        {
            get
            {
                return (bool)GetValue(IsYCAProperty);
            }
            set
            {
                SetValue(IsYCAProperty, value);
            }
        }
        private static void OnIsYCAChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.IsYCA = (bool)e.NewValue;
            }
        }
        #endregion
        #region ==IsMVT===========
        public static readonly DependencyProperty IsMVTProperty = DependencyProperty.Register("IsMVT",
        typeof(bool), typeof(ViewBase),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsMVTChanged));
        public bool IsMVT
        {
            get
            {
                return (bool)GetValue(IsMVTProperty);
            }
            set
            {
                SetValue(IsMVTProperty, value);
            }
        }
        private static void OnIsMVTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.IsMVT = (bool)e.NewValue;
            }
        }
        #endregion
        #region ==IsSXN===========
        public static readonly DependencyProperty IsSXNProperty = DependencyProperty.Register("IsSXN",
        typeof(bool), typeof(ViewBase),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsSXNChanged));
        public bool IsSXN
        {
            get
            {
                return (bool)GetValue(IsSXNProperty);
            }
            set
            {
                SetValue(IsSXNProperty, value);
            }
        }
        private static void OnIsSXNChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.IsSXN = (bool)e.NewValue;
            }
        }
        #endregion
        #region ==IsSYT===========
        public static readonly DependencyProperty IsSYTProperty = DependencyProperty.Register("IsSYT",
        typeof(bool), typeof(ViewBase),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsSYTChanged));
        public bool IsSYT
        {
            get
            {
                return (bool)GetValue(IsSYTProperty);
            }
            set
            {
                SetValue(IsSYTProperty, value);
            }
        }
        private static void OnIsSYTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.IsExpandAll = (bool)e.NewValue;
            }
        }
        #endregion
        #region ==IsTST===========
        public static readonly DependencyProperty IsTSTProperty = DependencyProperty.Register("IsTST",
        typeof(bool), typeof(ViewBase),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsTSTChanged));
        public bool IsTST
        {
            get
            {
                return (bool)GetValue(IsTSTProperty);
            }
            set
            {
                SetValue(IsTSTProperty, value);
            }
        }
        private static void OnIsTSTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.IsTST = (bool)e.NewValue;
            }
        }
        #endregion
        #region ==IsTYT===========
        public static readonly DependencyProperty IsTYTProperty = DependencyProperty.Register("IsTYT",
        typeof(bool), typeof(ViewBase),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsTYTChanged));
        public bool IsTYT
        {
            get
            {
                return (bool)GetValue(IsTYTProperty);
            }
            set
            {
                SetValue(IsTYTProperty, value);
            }
        }
        private static void OnIsTYTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.IsTYT = (bool)e.NewValue;
            }
        }
        #endregion
        #region ==IsYGR===========
        public static readonly DependencyProperty IsYGRProperty = DependencyProperty.Register("IsYGR",
        typeof(bool), typeof(ViewBase),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsYGRChanged));
        public bool IsYGR
        {
            get
            {
                return (bool)GetValue(IsYGRProperty);
            }
            set
            {
                SetValue(IsYGRProperty, value);
            }
        }
        private static void OnIsYGRChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.IsExpandAll = (bool)e.NewValue;
            }
        }
        #endregion 
        #region ==IsKWT===========
        public static readonly DependencyProperty IsKWTProperty = DependencyProperty.Register("IsKWT",
        typeof(bool), typeof(ViewBase),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsKWTChanged));
        public bool IsKWT
        {
            get
            {
                return (bool)GetValue(IsKWTProperty);
            }
            set
            {
                SetValue(IsKWTProperty, value);
            }
        }
        private static void OnIsKWTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.IsKWT = (bool)e.NewValue;
            }
        }
        #endregion

        #region ==IsGTT===========
        public static readonly DependencyProperty IsGTTProperty = DependencyProperty.Register("IsGTT",
        typeof(bool), typeof(ViewBase),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsGTTChanged));
        public bool IsGTT
        {
            get
            {
                return (bool)GetValue(IsGTTProperty);
            }
            set
            {
                SetValue(IsGTTProperty, value);
            }
        }
        private static void OnIsGTTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.IsGTT = (bool)e.NewValue;
            }
        }
        #endregion
        public void CompanySetup()
        {
            if (!app.IsLoaded) return;
            switch(app.company)
            {
                case "SJH":
                    IsSJH = true;
                    break;
                case "SYH":
                    IsSYH = true;
                    break;
                case "UBT":
                    IsUBT = true;
                    break;
                case "JLT":
                    IsJLT = true;
                    break;
                case "YCA":
                    IsYCA = true;
                    break;
                case "MVT":
                    IsMVT = true;
                    break;
                case "SYT":
                    IsSYT = true;
                    break;
                case "TST":
                    IsTST = true;
                    break;
                case "SXN":
                    IsSXN = true;
                    break;
                case "TYT":
                    IsTYT = true;
                    break;
                case "KWT":
                    IsKWT = true;
                    break;
                case "GTT":
                    IsGTT = true;
                    break;
                case "FHT":
                    IsFHT = true;
                    break;
            } 
        }
    }
}
